The invention relates generally to global locking mechanisms for controlling computer access to shared resources and more particularly to a locking mechanism that is implemented within a data storage system.
Often, when resources are shared by multiple users, e.g multiple applications running on a single host processor or multiple host processors, there must be some way of preventing more than one such user to access that resource at any one time. The shared resources can be almost any resource that might be needed by multiple users including, for example, memory, a data structure within memory, printers, communication devices, etc. Typically, access control for such a shared resource is accomplished through a locking mechanism, which may be very simple, as in the case of semaphore locks, or it may be very complex as in the case of systems which also provide deadlock detection, automatic release, and other features. The semaphore lock can be implemented by a flag stored in a predetermined storage location. If the flag is set, that means one of the users has acquired the semaphore and the relevant shared resource is not available. If the flag is cleared, that means no other user has acquired the semaphore and the requester can acquire the semaphore and access the shared resource.
Generally, such a locking mechanism must be implemented on a device that is also shared, or at least accessible, by all of the users that might need access to the shared resource to which access is being controlled. For example, in the case of multiple host computers connected to an intelligent data storage system, such as an integrated cache disk array system, the locking mechanism resides in shared memory within the data storage system. To obtain the semaphore for a resource, the requester (e.g. one of the host computers) must send an appropriate command to the data storage system over the communication channel linking the two together. Since the resource may not be available when requested, the user must wait a preselected period of time and try again, repeating this process (i.e., polling) until a lock is obtained. To reduce latency, i.e., time between when a lock is freed up and when another user gets the lock, the polling must be at a relatively high frequency e.g. 100 per second. During periods of high activity, such high polling rates can saturate the channel thereby seriously degrading the performance of the overall system. Furthermore, the high polling rate may build up the queue of I/O requests on the host computer side of the channel. Even though a resource might have become free and acquired early on, all of the remaining queued requests still must be serviced and answered.
One approach to addressing this problem has been to dedicate a separate channel for the lock requests. Thus, saturating that channel does not cut into the resources available for exchanging data between the host computer and the data storage system. But, of course, that approach has the disadvantage of eliminating that dedicated channel as a resource for exchanging data with the data storage system.